﻿using System.ComponentModel;
using System.Windows.Forms;

namespace WindowsAPI.Windows
{
    public partial class WindowViewerControl : UserControl
    {
        protected Window f_Window;

        [Bindable(false), Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public Window Window { get { return f_Window; } set { View(value); } }

        public WindowViewerControl() { InitializeComponent(); }

        public virtual void Clear()
        {
            f_Window = null;
        }

        public virtual void View(Window w)
        {
            if(w != f_Window) Clear();

            f_Window = w;
        }
    }
}
